// pages/main/main.js
const http =require('../../utils/http')
Page({
  data: {
list:[],
likelist:[],
swiperimg:[],
swiperimagelist:[]
,imagecount:1
  },

  /**
   * 生命周期函数--监听页面加载
   */
  gosearch(){
wx.switchTab({
  url: '/pages/find/find',
})
  },

  changetype(ev){

    this.setData({imagecount:ev.detail.current+1})
  },
  onLoad(options) {
    http.request('/product/product/getProductRecommendUser','POST','{"pageNow":1,"pageSize":20,"orderBy":"top","desc":false,"seller_user_id":"4bc4027c645343f09a964b5c2e9f875b"}').then(res=>{
    
      this.setData({list:res.data})
    });
    http.request('/requirement/request/getMatchedProducts','POST','{"desc":false,"orderBy":"outtime","product_type":2,"pageSize":100}').then(res=>{
      console.log(res);
      this.setData({swiperimagelist:res.data.matchedProducts})
    });
    http.request('product/product/guessYouLike','GET','').then(res=>{
      this.setData({likelist:res.data})
    });
    http.request('/product/banner/getBySeller/4bc4027c645343f09a964b5c2e9f875b','GET','{"desc":false,"orderBy":"outtime","product_type":2,"pageSize":100}').then(res=>{
      this.setData({swiperimg:res.data})
    });
  

  
   
  

  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady() {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow() {

  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide() {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload() {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh() {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom() {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage() {

  }
})